% ALTADENA experiment simulation for the parahydrogenation of acrolein
% into propanal. Simple model of the ALTADENA effect is used: perfect-
% ly adiabatic transfer is assumed and the isotropic mixing in low fi-
% eld is ignored completely. Note the small flip angle.
%
% Ronghui Zhou (hui@ufl.edu)
% i.kuprov@soton.ac.uk

function altadena_propanal_in_progress()
clc;clear;
tic;
% Spin system
sys.isotopes={'1H','1H','1H','1H','1H','1H'};

% Magnetic field
sys.magnet=7.05;

% Chemical shifts
inter.zeeman.scalar={0.95 0.95 0.95 1.65 1.65 9.44};

% Scalar couplings
inter.coupling.scalar=cell(6);
inter.coupling.scalar{1,4}=7.5;   inter.coupling.scalar{2,4}=7.5;
inter.coupling.scalar{3,4}=7.5;   inter.coupling.scalar{1,5}=7.5;
inter.coupling.scalar{2,5}=7.5;   inter.coupling.scalar{3,5}=7.5;
inter.coupling.scalar{4,6}=1.1;   inter.coupling.scalar{5,6}=1.1;

% Basis set
bas.mode='complete';
bas.sym_group={'S3','S2'};
bas.sym_spins={[1 2 3],[4 5]};

% Spinach housekeeping
spin_system=create(sys,inter);
spin_system=basis(spin_system,bas);

% Sequence parameters
parameters.spins={'1H'};
parameters.rho_init=state(spin_system,{'Lz','Lz'},{1,4})-...
                0.5*state(spin_system,{'Lz'},{1})+...
                0.5*state(spin_system,{'Lz'},{4});
parameters.coil=state(spin_system,'L+','1H');
parameters.pulse_op=(operator(spin_system,'L+','1H')-operator(spin_system,'L-','1H'))/2i;
parameters.pulse_angle=pi/2;
parameters.offset=1500;
parameters.sweep=3000;
parameters.npoints=1024;
parameters.zerofill=8192;
parameters.axis_units='ppm';
parameters.invert_axis=1;

% Simulation
fid=liquid(spin_system,@pulse_acquire,parameters,'nmr');

% Apodization
fid=apodization(fid,'gaussian-1d',10);

% Fourier transform
spectrum=fftshift(fft(fid,parameters.zerofill));

% Plotting
plot_1d(spin_system,real(spectrum),parameters);

toc;
end

